// pages/roomdetail/roomdetail.js
var app = getApp();
Page({
  
  /**
   * 页面的初始数据
   */
  data: {
    movies: [
      { url: 'http://bmbdc.com/bmxcximg/daybanner.png' },
      { url: 'http://bmbdc.com/bmxcximg/daybanner.png' },
      { url: 'http://bmbdc.com/bmxcximg/daybanner.png' },
      { url: 'http://bmbdc.com/bmxcximg/daybanner.png' },
      { url: 'http://bmbdc.com/bmxcximg/daybanner.png' },
      { url: 'http://bmbdc.com/bmxcximg/daybanner.png' },
    ],
    cur:1,
    num:0,
    // 计算器选择
    _num: 1, 
    listData: [
      { "code": "1", "text": "8250", "type": "4083.33","other":"4166.67","all":"02"},
      { "code": "2", "text": "8250", "type": "4083.33", "other": "4166.67", "all": "02"},
      { "code": "3", "text": "8250", "type": "4083.33", "other": "4166.67", "all": "02"},
      { "code": "4", "text": "8250", "type": "4083.33", "other": "4166.67", "all": "02"},
      { "code": "5", "text": "8250", "type": "4083.33", "other": "4166.67", "all": "02"},
      { "code": "6", "text": "8250", "type": "4083.33", "other": "4166.67", "all": "02"},
      { "code": "7", "text": "8250", "type": "4083.33", "other": "4166.67", "all": "02"}
    ],
    selected: true,
    selected1: false,
    selected2: false,
  },
  markers: [{
    iconPath: "../../img/marker_red.png",
    id: 0,
    latitude: 40.002607,
    longitude: 116.487847,
    width: 35,
    height: 45
  }],

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    // 获得轮播图的数量
    var list=this.data.movies.length;
    this.setData({
      num: list
    })
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  },
  swiperChange:function(e){
   var index=e.detail.current;
    this.setData({
      cur: index+1
    })
  }, 
  // 计算器选择
  clachose: function (e) {
    console.log(e.target.dataset.num)
    this.setData({
      _num: e.target.dataset.num
    })
  },
  selected: function (e) {
    this.setData({
      selected2: false,
      selected1: false,
      selected: true
    })
  },
  selected1: function (e) {
    this.setData({
      selected2: false,
      selected1: true,
      selected: false
    })
  },
  selected2: function (e) {
    this.setData({
      selected2: true,
      selected1: false,
      selected: false
    })
  },
  samehouseurl:function(){
    wx.navigateTo({
      url: '../samecommunity/samecommunity',
    })
  },
  houseinformat:function(){
    wx.navigateTo({
      url: '../realestatedetails/realestatedetails',
    })
  }
})